<?php
header('Content-Type:text/html;charset=gbk');
require_once("db_manage.php");
//require_once './bbs/include/common.inc.php';
session_start();
$username = $_SESSION['username'];
/*
			//upload dir
			$uploaddir = './upload/images/';
			if ($_POST[sendfiles]) { 				
				foreach ($_FILES[photos][name] as $key => $value) {					
					//set image's name like 20081201211618 format
					$uploadfile = date('YmdHis');
					$path_parts = pathinfo( $value);
					//get image file's extension
					$ext = $path_parts["extension"];				
					//
					$uploadfile = $uploaddir . $uploadfile.$key .".". $ext ;
					$path_parts = pathinfo($uploadfile);
					$name = $path_parts["basename"];	
					//add to a full name
					if (move_uploaded_file($_FILES['photos']['tmp_name'][$key], $uploadfile)) { 					
						//echo "<br><br>name:".$name."<br>uploadfile:".$uploadfile."<br>cid:".$cid."<br>userid:".$userid;
						image_add($name, $uploadfile, $cid, "c", $userid);
					}
				}
			}
			*/
// upload dir	
$intro = $_POST['intro'];		
$textlink = $_POST['textlink'];
$turn = $_POST['turn'];
$uploaddir = './upload/images/';
$uploadfile = date('YmdHis');
$filename = basename($_FILES['userfile']['name']);
$path_parts = pathinfo($filename);
$ext = $path_parts["extension"];
$uploadfile = $uploaddir.$uploadfile.".".$ext;
if(move_uploaded_file($_FILES['userfile']['tmp_name'],$uploadfile)){	
	$flash = array($intro,$textlink,$username,$turn,$uploadfile);
	addFlashHot($flash);	
}

echo "<script>location.href='manage_home_flashhot.php';</script>";
/*
$uploadfile = $uploaddir . 'jioj.jpg';
echo $uploadfile;
echo '<pre>';
if (move_uploaded_file($_FILES['imageupload']['tmp_name'], $uploadfile)) {
   echo "File is valid, and was successfully uploaded.\n";
} else {
   echo "Possible file upload attack!\n";
}
echo 'Here is some more debugging info:';
print_r($_FILES);
print "</pre>";
*/
?> 